<template>
    <van-form @submit="onSubmit">
        <van-cell-group inset>
            <van-field
                v-model="username"
                name="用户名"
                label="用户名"
                placeholder="用户名"
                :rules="[{ required: true, message: '请填写用户名' }]"
            />
            <van-field
                v-model="tel"
                name="电话号码"
                label="电话号码"
                placeholder="电话号码"
                :rules="[{ required: true, message: '请填写电话号码' }]"
            />

            <van-field
                v-model="address"
                name="收货地址"
                label="收货地址"
                placeholder="收货地址"
                :rules="[{ required: true, message: '请填写收货地址' }]"
            />
        </van-cell-group>
        <div style="margin: 16px">
            <van-button round block type="primary" native-type="submit">
                提交收货地址
            </van-button>
        </div>
    </van-form>
</template>

<script setup lang="ts">
import { useOnAdd } from '@/hooks/onAdd'

const { username, tel, address, onSubmit } = useOnAdd()
</script>

<style scoped></style>
